//
//  ViewController.m
//  UIDatePicker
//
//  Created by clz on 2019/8/11.
//  Copyright © 2019年 clz. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@property(nonatomic,strong)UIDatePicker *datePicker;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    UIDatePicker
    self.datePicker = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 300)];
    [self.view addSubview:self.datePicker];
    [self.datePicker addTarget:self action:@selector(dateChange:) forControlEvents:UIControlEventValueChanged];
    
    self.datePicker.minimumDate = [NSDate dateWithTimeIntervalSinceNow:86400];
    self.datePicker.maximumDate = [NSDate dateWithTimeIntervalSinceNow:172800];
    [self.datePicker setDatePickerMode:UIDatePickerModeTime];
    
}

- (void)dateChange:(UIDatePicker *)sender{
    
    NSLog(@"sender.date = %@",sender.date);
}


@end
